

const checkAll = (state,dispatch) => {
  // 改变选择列表的状态
  let detailList = []
    if(state.allChecked){
      detailList=state.detailList.map(item=>{
        item.checked = false
        return item
      })
    }else{
      detailList=state.detailList.map(item=>{
        item.checked = true
        return item
      })
    }
    dispatch({
      type: 'detailList',
      detailList
    })
}

export default checkAll
